<?php

require_once BASE_URL . '/base/BaseController.php';


require_once 'db.php';
$db = $config['database'];
$model = new DB($db);

require_once BASE_URL . '/base/BaseModel.php';


/**
 * $config已经存在
 * @param $table
 * 实例化模型
 */

function db()
{
    global $model;
    return $model;
}

function D($model)
{
    $model = new $model();
    return $model;
}
function I($data){
    foreach($data as $k=>$v){
        $data[$k] = htmlspecialchars($v);
    }
    return $data;
}

